package com.gitee.wsl.mathematics.vector.ext

import com.gitee.wsl.mathematics.vector.Vector

fun<T:Number,K: Vector<T, K>> K.fade(): K {
    val a = this
    /*val t = a * a * a
    val o = a * 6f - 15f
    val d = a * o
    val z = d + 10f
    return t * d*/
    return (a * a * a) * (a * (a * 6f - 15f) + 10f)
}

fun<T:Number,K: Vector<T, K>> K.taylorInvSqrt(): K = 1.7928429f - 0.85373473f * this